import java.io.*;
import java.util.ArrayDeque;
import java.util.Queue;

/**
 * Tokens and parsing.
 */

public class Main {
	public static Queue<Integer> inputData = new ArrayDeque<Integer>();

	public static void go(String[] files) {
		Tokens tokens = null;
		try {
			tokens = new Tokens(files[0]);
			BufferedReader input = new BufferedReader(new FileReader(files[1]));
			StringBuilder s = new StringBuilder();

			while (input.ready()) {
				StringBuilder tmp = new StringBuilder(input.readLine());
				while (tmp.length() > 0) {
					if (Character.isDigit(tmp.charAt(0))
							|| (tmp.charAt(0) == '-')) {
						s.append(tmp.charAt(0));
						tmp.deleteCharAt(0);
					} else {
						if (Character.isWhitespace(tmp.charAt(0))) {
							tmp.deleteCharAt(0);
							if (s.length() > 0) {
								inputData.add(Integer.parseInt(s.toString()));
								s = new StringBuilder();
							}
						} else {
							System.err.println("Invalid Data input :"
									+ tmp.charAt(0));
							System.exit(0);
						}
					}
					if ((tmp.length() == 0) && (s.length() > 0)) {
						inputData.add(Integer.parseInt(s.toString()));
						s = new StringBuilder();
					}
				}
			}
		} catch (Exception e) {
			System.exit(1);
		}
		PloProgram p = new PloProgram(tokens);
		p.runProgram();
	}
}
